package com.wangzha.common.enums;

public enum TaskExecuteTypeEnum {

    NOW("立即执行"), TIMING("定时执行");
    String name;

    TaskExecuteTypeEnum(String name) {
        this.name = name;
    }

    public String getName() {
        return name;
    }

    public static String getName(Integer state) {
        if (state == null) {
            return null;
        }
        for (TaskExecuteTypeEnum typeEnum : TaskExecuteTypeEnum.values()) {
            if (typeEnum.ordinal() == state) {
                return typeEnum.name;
            }
        }
        return null;
    }
}
